Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 2 - Shape Objects / Shape Objects Reference
Constants and Data Types


The Spool Block

The spool block structure is set up by an application before calling GXFlattenShape or GXUnflattenShape. Both the application and QuickDraw GX use and place values into the spool block.

struct gxSpoolBlock {
   gxSpoolProcPtr    spoolProcedure;
   void              *buffer;
   long              bufferSize;
   long              count;
   long              operationSize;
   long              operationOffset;
   gxGraphicsOpcode  lastTypeOpcode;
   gxGraphicsOpcode  currentOperation;
   gxGraphicsOpcode  currentOperand;
   unsigned char     compressed;
};
Field Description
spoolProcedure
A pointer to an application-defined function that either saves
the flattened data or supplies the data for unflattening. The gxSpoolProcPtr type is defined as follows:
               typedef long (*gxSpoolProcPtr)
                              (gxSpoolCommand command, 
                              struct gxSpoolBlock *block);
The format for the spool function is described on page 2-91.
buffer
A pointer to a buffer that holds the flattened data, after flattening or before unflattening. In either case the buffer is allocated by the application.
bufferSize
The size of the buffer. (Set by the application.)
count
The number of bytes of data read into or out of the buffer. (Set by QuickDraw GX.)
operationSize
The size of the current operation in the flattened stream. It is equal to the size field of the operand of the current operation. For flattening, it is the amount of data that QuickDraw GX will place into the buffer to complete the current operation; for unflattening,
it is the amount of information that the spool function must
place in the buffer to complete the current operation. (Set by QuickDraw GX.)
operationOffset
For flattening, the offset in bytes from the beginning of the current operation to the end of the data currently in the buffer. For unflattening, the offset in bytes from the beginning of the current operation to the start of the data that needs to be placed in the buffer. It is the amount of the current operation that has so far been flattened or is about to be unflattened. (Set by QuickDraw GX.)
lastTypeOpcode
The type of object currently being flattened or unflattened. It is one of the constants defined in the gxGraphicsNewOpcode enumeration. (Set by QuickDraw GX.)
currentOperation
The type of operation currently being flattened or unflattened. It is one of the constants defined in the gxGraphicsOperationOpcode enumeration. (Set by QuickDraw GX.)
currentOperand
The type of data (within the current object) being flattened or unflattened. It is one of the constants defined in one of the data opcode enumerations, such as the gxShapeDataOpcode enumeration or the gxStyleDataOpcode enumeration. (Set
by QuickDraw GX.)
compressed
The type of compression applied to the current item. (Set by QuickDraw GX.)
General information about flattening shapes is found in the section "Flattening and Unflattening Shapes" beginning on page 2-39. The GXFlattenShape function is described on page 2-88. The GXUnflattenShape function is described on page 2-90. The QuickDraw GX stream format, including the opcodes it uses and the types of compression it supports, is described in the stream format chapter of Inside Macintosh: QuickDraw GX Environment and Utilities.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996